package com.yingjia.yingjiauniversity.http.datasource;

import android.support.annotation.NonNull;

import com.yingjia.yingjiauniversity.bean.base.SignatureEntity;
import com.yingjia.yingjiauniversity.bean.http.ObtainSignature;

import io.reactivex.Observable;

/**
 * @author mars.yu
 * @date 2018/5/17
 */

public class SignatureRepository implements SignatureDataSource {

    private SignatureDataSource signatureDataSource;
    private static SignatureRepository INSTANCE;

    public static SignatureRepository getInstance(SignatureDataSource signatureDataSource) {
        if (INSTANCE == null) {
            INSTANCE = new SignatureRepository(signatureDataSource);
        }
        return INSTANCE;
    }

    private SignatureRepository(@NonNull SignatureDataSource signatureDataSource) {
        this.signatureDataSource = signatureDataSource;
    }

    @Override
    public Observable<SignatureEntity<ObtainSignature>> getSignatureInfo(String orderNo) {
        return signatureDataSource.getSignatureInfo(orderNo);
    }

}
